Skip to content

wasm2js: Switch optimizations#2141

Merged
kripken merged 8 commits intomasterfrom
sw
May 28, 2019
Merged

wasm2js: Switch optimizations#2141
kripken merged 8 commits intomasterfrom
sw

Conversation

@kripken
Copy link
Copy Markdown
Member

@kripken kripken commented May 24, 2019

This pattern-matches towers of blocks + a br_table into a JS switch. This is much smaller in code size and also avoids heavy nesting that can exceed the recursion limits of JS parsers.

This is not enough yet, because it pattern-matches very specifically. In reality, switches can look slightly different. Followup PRs will extend this. For now, this passes the test suite (what passed before - not including the massive-switch tests) + fuzzing so it's a good start.

@kripken kripken merged commit 4b223a3 into master May 28, 2019
@kripken kripken deleted the sw branch May 28, 2019 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant